package com.jhopesoft.business.sales.entity;
// default package
// Generated 2018-3-6 16:54:10 by Hibernate Tools 5.2.6.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.GenericGenerator;

/**
 * SlCustomer generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "sl_customer", uniqueConstraints = @UniqueConstraint(columnNames = "name_"))
public class SlCustomer implements java.io.Serializable {

	private String id;
	private SlCity slCity;
	private SlTrade slTrade;
	private String name;
	private String ratelevel;
	private Set<SlOrder> slOrders = new HashSet<SlOrder>(0);

	public SlCustomer() {
	}

	public SlCustomer(String id, SlCity slCity, SlTrade slTrade, String name, String ratelevel) {
		this.id = id;
		this.slCity = slCity;
		this.slTrade = slTrade;
		this.name = name;
		this.ratelevel = ratelevel;
	}

	public SlCustomer(String id, SlCity slCity, SlTrade slTrade, String name, String ratelevel, Set<SlOrder> slOrders) {
		this.id = id;
		this.slCity = slCity;
		this.slTrade = slTrade;
		this.name = name;
		this.ratelevel = ratelevel;
		this.slOrders = slOrders;
	}

	@Id
  @GeneratedValue(generator = "generator")
  @GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Column(name = "id_", unique = true, nullable = false, length = 40)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cityid_", nullable = false)
	public SlCity getSlCity() {
		return this.slCity;
	}

	public void setSlCity(SlCity slCity) {
		this.slCity = slCity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tradeid_", nullable = false)
	public SlTrade getSlTrade() {
		return this.slTrade;
	}

	public void setSlTrade(SlTrade slTrade) {
		this.slTrade = slTrade;
	}

	@Column(name = "name_", unique = true, nullable = false, length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "ratelevel", nullable = false, length = 2)
	public String getRatelevel() {
		return this.ratelevel;
	}

	public void setRatelevel(String ratelevel) {
		this.ratelevel = ratelevel;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "slCustomer")
	public Set<SlOrder> getSlOrders() {
		return this.slOrders;
	}

	public void setSlOrders(Set<SlOrder> slOrders) {
		this.slOrders = slOrders;
	}

}
